package com.systop.ltbook;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.ResourceBundle;

import com.systop.core.util.ResourceBundleUtil;

import edu.emory.mathcs.backport.java.util.Collections;

/**
 * 龙天图书管理常量类
 */
@SuppressWarnings("unchecked")
public class BookConstants {

	/**
	 * 私有构造器
	 */
	private BookConstants(){
	}
	
	/** 资源文件 */
  private static final String BUNDLE_KEY = "application";

  /** 资源绑定对象 */
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_KEY);
  
	/** 
	 * 图书封面照片上传路径
	 */
  public static final String BOOK_PHOTOS_FOLDER = ResourceBundleUtil.getString(RESOURCE_BUNDLE,
      "book_photos_file_path", "/uploadFiles/book/photos/");
  
  /** 最新的 */
  public static final String TYPE_NEW = "1";
  /** 热销的 */
  public static final String TYPE_HOT = "2";
  /** 特价的 */
  public static final String TYPE_CHEEP = "3";
  /** 最新 热销 */
  public static final String TYPE_N_H = "1,2";
  /** 最新  特价*/
  public static final String TYPE_N_C = "1,3";
  /** 热销 特价 */
  public static final String TYPE_H_C = "2,3";
  /** 最新 热销 特价 */
  public static final String TYPE_N_H_C = "1,2,3";
    
  /** 首页图片显示_最新图书条数 */
  public static final int NWE_BOOK_PAGE_ZISE = ResourceBundleUtil.getInt(RESOURCE_BUNDLE,
      "new_book_page_size", 6);
  
  /** 首页图片显示_热销图书条数 */
  public static final int HOT_BOOK_PAGE_ZISE = ResourceBundleUtil.getInt(RESOURCE_BUNDLE,
      "hot_book_page_size", 7);
  
  /** 首页图片显示_特价图书条数 */
  public static final int CHEEP_BOOK_PAGE_ZISE = ResourceBundleUtil.getInt(RESOURCE_BUNDLE,
      "cheep_book_page_size", 7);
  
  /** 更多图书显示时每页图书的数量*/
  public static final Integer MORE_BOOKS_PAGE_ZISE =  ResourceBundleUtil.getInt(RESOURCE_BUNDLE,
      "more_book_page_size", 28);
  
  /** 包装描述 */
  public static final Map<String, String> PACKDESCN_MAP = new LinkedHashMap<String, String>();
  public static String PACKDESCN_PZ = "PZ";
  public static String PACKDESCN_JZ = "JZ";
  public static String PACKDESCN_XZ = "XZ";
  public static String PACKDESCN_DZ = "DZ";
  public static String PACKDESCN_HZ = "HZ";
  static {
	  PACKDESCN_MAP.put(PACKDESCN_PZ, "平装");
	  PACKDESCN_MAP.put(PACKDESCN_JZ, "精装");
	  PACKDESCN_MAP.put(PACKDESCN_XZ, "线装");
	  PACKDESCN_MAP.put(PACKDESCN_DZ, "袋装");
	  PACKDESCN_MAP.put(PACKDESCN_HZ, "盒装");
  }
  
  /** 纸张描述 */
  public static final Map<String, String> PAPERDESC_MAP = new LinkedHashMap<String, String>();
  public static String PAPERDESC_JB = "jb";
  public static String PAPERDESC_TB = "tb";
  static {
	  PAPERDESC_MAP.put(PAPERDESC_JB, "胶版纸");
	  PAPERDESC_MAP.put(PAPERDESC_TB, "铜版纸");
  }
  
  /** 开本类型 */
  public static final Map<String, String> BOOKSIZE_MAP = new LinkedHashMap<String, String>();
  public static String BOOKSIZE_8 = "8";
  public static String BOOKSIZE_B16 = "B16";
  public static String BOOKSIZE_16 = "16";
  public static String BOOKSIZE_24 = "24";
  public static String BOOKSIZE_B32 = "B32";
  public static String BOOKSIZE_32 = "32";
  public static String BOOKSIZE_64 = "64";
  static {
	  BOOKSIZE_MAP.put(BOOKSIZE_8, "　8开");
	  BOOKSIZE_MAP.put(BOOKSIZE_B16, "大16开");
	  BOOKSIZE_MAP.put(BOOKSIZE_16, "　16开");
	  BOOKSIZE_MAP.put(BOOKSIZE_24, "　24开");
	  BOOKSIZE_MAP.put(BOOKSIZE_B32, "大32开");
	  BOOKSIZE_MAP.put(BOOKSIZE_32, "　32开");
	  BOOKSIZE_MAP.put(BOOKSIZE_64, "　64开");
  }
  
  /** 图书类型Map */
  public static final Map<String, String> BOOK_TYPE_MAP = Collections.synchronizedMap(
  		new LinkedHashMap<String, String>());
  
  static {
  	BOOK_TYPE_MAP.put(TYPE_NEW, "<font color='blue'>新书</font>");
  	BOOK_TYPE_MAP.put(TYPE_HOT, "<font color='green'>热销</font>");
  	BOOK_TYPE_MAP.put(TYPE_CHEEP, "<font color='red'>特价</font>");
  	BOOK_TYPE_MAP.put(TYPE_N_H, "<font color='blue'>新书</font>&nbsp;<font color='green'>热销</font>");
  	BOOK_TYPE_MAP.put(TYPE_N_C, "<font color='blue'>新书</font>&nbsp;<font color='red'>特价</font>");
  	BOOK_TYPE_MAP.put(TYPE_H_C, "<font color='green'>热销</font>&nbsp;<font color='red'>特价</font>");
  	BOOK_TYPE_MAP.put(TYPE_N_H_C, "<font color='blue'>新书</font>&nbsp;<font color='green'>热销</font>&nbsp;<font color='red'>特价</font>");
  }
  
  /** 小学  */
	public static final String GRADE_PRIMARY = "P";
	/** 一年级  */
	public static final String GRADE_PRIMARY_ONE = "P1";
	/** 二年级  */
	public static final String GRADE_PRIMARY_TWO = "P2";
	/** 三年级  */
	public static final String GRADE_PRIMARY_THREE = "P3";
	/** 四年级  */
	public static final String GRADE_PRIMARY_FOUR = "P4";
	/** 五年级  */
	public static final String GRADE_PRIMARY_FIVE = "P5";
	/** 六年级  */
	public static final String GRADE_PRIMARY_SIX = "P6";
	/** 初中  */
	public static final String GRADE_JUNIOR = "J";
	/** 初一  */
	public static final String GRADE_JUNIOR_ONE = "J1";
	/** 初二  */
	public static final String GRADE_JUNIOR_TWO = "J2";
	/** 初三  */
	public static final String GRADE_JUNIOR_THREE = "J3";
	/** 高中  */
	public static final String GRADE_SENIOR = "S";
	/** 高一  */
	public static final String GRADE_SENIOR_ONE = "S1";
	/** 高二  */
	public static final String GRADE_SENIOR_TWO = "S2";
	/** 高三  */
	public static final String GRADE_SENIOR_THREE = "S3";
	/** 考试 */
	public static final String GRADE_EXAM = "E";
	/** 小升初*/
	public static final String GRADE_PRIMARY_EXAM = "E1";
	/** 中考 */
	public static final String GRADE_JUNIOR_EXAM = "E2";
	/** 高考 */
	public static final String GRADE_SENIOR_EXAM = "E3";
	
	/** 年级Map */
	public static final Map<String, String> GRADE_MAP = Collections.synchronizedMap(
			new LinkedHashMap<String, String>());
	/** 年级Map */
	public static final Map<String, String> GRADE_NAME_MAP = Collections.synchronizedMap(
			new LinkedHashMap<String, String>());
	static {
		GRADE_MAP.put(GRADE_PRIMARY, "------------小学------------");
		GRADE_MAP.put(GRADE_PRIMARY_ONE, "一年级");
		GRADE_MAP.put(GRADE_PRIMARY_TWO, "二年级");
		GRADE_MAP.put(GRADE_PRIMARY_THREE, "三年级");
		GRADE_MAP.put(GRADE_PRIMARY_FOUR, "四年级");
		GRADE_MAP.put(GRADE_PRIMARY_FIVE, "五年级");
		GRADE_MAP.put(GRADE_PRIMARY_SIX, "六年级");
		GRADE_MAP.put(GRADE_JUNIOR, "------------初中------------");
		GRADE_MAP.put(GRADE_JUNIOR_ONE, "初一");
		GRADE_MAP.put(GRADE_JUNIOR_TWO, "初二");
		GRADE_MAP.put(GRADE_JUNIOR_THREE, "初三");
		GRADE_MAP.put(GRADE_SENIOR, "------------高中------------");
		GRADE_MAP.put(GRADE_SENIOR_ONE, "高一");
		GRADE_MAP.put(GRADE_SENIOR_TWO, "高二");
		GRADE_MAP.put(GRADE_SENIOR_THREE, "高三");
		GRADE_MAP.put(GRADE_EXAM, "------------考试------------");
		GRADE_MAP.put(GRADE_PRIMARY_EXAM, "小升初");
		GRADE_MAP.put(GRADE_JUNIOR_EXAM, "中考");
		GRADE_MAP.put(GRADE_SENIOR_EXAM, "高考");
	}
	static {
		GRADE_NAME_MAP.put(GRADE_PRIMARY, "小学");
		GRADE_NAME_MAP.put(GRADE_PRIMARY_ONE, "一年级");
		GRADE_NAME_MAP.put(GRADE_PRIMARY_TWO, "二年级");
		GRADE_NAME_MAP.put(GRADE_PRIMARY_THREE, "三年级");
		GRADE_NAME_MAP.put(GRADE_PRIMARY_FOUR, "四年级");
		GRADE_NAME_MAP.put(GRADE_PRIMARY_FIVE, "五年级");
		GRADE_NAME_MAP.put(GRADE_PRIMARY_SIX, "六年级");
		GRADE_NAME_MAP.put(GRADE_JUNIOR, "初中");
		GRADE_NAME_MAP.put(GRADE_JUNIOR_ONE, "初一");
		GRADE_NAME_MAP.put(GRADE_JUNIOR_TWO, "初二");
		GRADE_NAME_MAP.put(GRADE_JUNIOR_THREE, "初三");
		GRADE_NAME_MAP.put(GRADE_SENIOR, "高中");
		GRADE_NAME_MAP.put(GRADE_SENIOR_ONE, "高一");
		GRADE_NAME_MAP.put(GRADE_SENIOR_TWO, "高二");
		GRADE_NAME_MAP.put(GRADE_SENIOR_THREE, "高三");
		GRADE_NAME_MAP.put(GRADE_EXAM, "考试");
		GRADE_NAME_MAP.put(GRADE_PRIMARY_EXAM, "小升初");
		GRADE_NAME_MAP.put(GRADE_JUNIOR_EXAM, "中考");
		GRADE_NAME_MAP.put(GRADE_SENIOR_EXAM, "高考");
	}
	
	/** 小学 */
	public static final Map<String, String> PRIMARY_MAP = Collections.synchronizedMap(
			new LinkedHashMap<String, String>());
	/** 初中 */
	public static final Map<String, String> JUNIOR_MAP = Collections.synchronizedMap(
			new LinkedHashMap<String, String>());
	/** 高中 */
	public static final Map<String, String> SENIOR_MAP = Collections.synchronizedMap(
			new LinkedHashMap<String, String>());
	static {
		PRIMARY_MAP.put(GRADE_PRIMARY_ONE, "一年级");
		PRIMARY_MAP.put(GRADE_PRIMARY_TWO, "二年级");
		PRIMARY_MAP.put(GRADE_PRIMARY_THREE, "三年级");
		PRIMARY_MAP.put(GRADE_PRIMARY_FOUR, "四年级");
		PRIMARY_MAP.put(GRADE_PRIMARY_FIVE, "五年级");
		PRIMARY_MAP.put(GRADE_PRIMARY_SIX, "六年级");
		PRIMARY_MAP.put(GRADE_PRIMARY_EXAM, "<font color='red'>小升初</font>");
	}
	static {
		JUNIOR_MAP.put(GRADE_JUNIOR_ONE, "初一");
		JUNIOR_MAP.put(GRADE_JUNIOR_TWO, "初二");
		JUNIOR_MAP.put(GRADE_JUNIOR_THREE, "初三");
		JUNIOR_MAP.put(GRADE_JUNIOR_EXAM, "<font color='red'>中考</font>");
	}
	static {
		SENIOR_MAP.put(GRADE_SENIOR_ONE, "高一");
		SENIOR_MAP.put(GRADE_SENIOR_TWO, "高二");
		SENIOR_MAP.put(GRADE_SENIOR_THREE, "高三");
		SENIOR_MAP.put(GRADE_SENIOR_EXAM, "<font color='red'>高考</font>");
	}
}
